﻿using ReflectionStudio.Controls;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Data.OracleClient;
using WPFExcelReport;
using WPFExcelReport.Helpers;
namespace INTEX.DataBase.Tools
{
    //TBList="ICC_QUERYTB;ICC_TXTKON;ICC_WFEVENTS;ICC_WFSUBSCRIBER;";//INTEXBL
    /*
     
DROP TABLE ICC_QUERYTB
GO
  CREATE TABLE "INTEX"."ICC_QUERYTB"
  AS
  SELECT
  VKKAUFKRS AS KRS,VKKAUFLFD AS LFD,
  ' ' AS C1,'  ' AS C2,'   ' AS C3,'                    ' AS C20,
  '20140916' AS DSTART,  '20140901' AS DEND,
  VKKMANDANT,VKKAUFKRS,VKKAUFLFD
  ,VKPMANDANT,VKPAUFKRS,VKPAUFLFD,VKPAUFPOS
  ,ABPMANDANT,ABPAUFKRS,ABPAUFLFD,ABPAUFPOS
    ,TXTIMANDANT,TXTITXTART,TXTISIND,
KDMANDANT,KDKUNDNR,
VKAMANDANT,VKAAUFKRS,VKAAUFLFD,
ZABMANDANT,ZABNR,
KDSKUNDNR,
HRMANDANT,HRBENID,
GLOMANDANT,GLOITEM,
KDAKUNDNR,
ABAMANDANT,ABAVKAUFKRS,ABAVKAUFLFD
  FROM VKKOPF,
   VKPOS,
  ABPOS,
  TXTIND,
   KDSTAMM,
   VKADR,
   ZABED,
   KDANSP,
   ABAUFM,
   glopitem,
   KUNDADR,
   HRSTAMM
   WHERE ROWNUM<1
   GO
     */
    public partial class INTEXBL : BaseFunction
    {
        public string Company = "ITX";
        public DateTime tomorrow = DateTime.Now.AddDays(1);
        public DateTime yesterday = DateTime.Now.AddDays(-1);
        public string ITXMANDANT = "00", ITXUSER = "ITXVVVK ", ITXDATE = "20120723";
        public string today = "";
        OracleCommand or1;
        public GB2312Convert8859P1 gb2312 = new GB2312Convert8859P1();
        ApplicationBase app
        {
            get
            {
                return ApplicationBase.Instance;
            }
        }
        public INTEXDBC INTEXDBC
        {
            get
            {
                return app.INTEXDBC;
            }
        }
        SETINTEXDB INTEXDB = new SETINTEXDB();
        public string ApplicationPath
        {
            get { return System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath); }
        }

        public void SignalRSTART()
        {
            or1 = OracleDB.CreateCommand();
            Connect2Proxy(or1, "CHKZLAPP");
            Connect2Proxy(or1, "SignalRSTART");
        }
        public void ZLANSTART()
        {
            or1 = OracleDB.CreateCommand();
            Connect2Proxy(or1, "CHKZLAPP");
            Connect2Proxy(or1, "ZLANSTART");
        }
        public void ZLANRESET()
        {
            or1 = OracleDB.CreateCommand();
            Connect2Proxy(or1, "CHKZLAPP");
            Connect2Proxy(or1, "ZLANRESET");
        }
        public void ZLANSTOP()
        {
            or1 = OracleDB.CreateCommand();
            Connect2Proxy(or1, "CHKZLAPP");
            Connect2Proxy(or1, "ZLANSTOP");
        }
        public INTEXBL()
        {
            Helper.GetDate(ref date, ref year, ref month, ref day);
        }
        public void ShowDoucument(string _exe, string _page)
        {
            //不经过WorkFlowDocument,直接触发界面
            string WFEHANDLER = _exe;
            MessageInfo msg = new MessageInfo(MessageEventType.Info, WFEHANDLER, "WORKFLOW", _page);
            EventDispatcher.Instance.RaiseMessage(msg);
        }
        public void CloseDoucument(string _exe)
        {
            //不经过WorkFlowDocument,直接触发界面
            string WFEHANDLER = _exe;
            MessageInfo msg = new MessageInfo(MessageEventType.Info, WFEHANDLER, "WORKFLOW", "-1");
            EventDispatcher.Instance.RaiseMessage(msg);
        }
    }
}